package edu.uwm.universitydb.swing;

import javax.swing.table.AbstractTableModel;


public abstract class DataTableModel extends AbstractTableModel {

	/**
	 * @param colNames 	Names to display in the Table Header
	 * @param colTypes 	Types of values in the column header
	 */
	public DataTableModel(String [] colNames, Class<?>[] colTypes) {
		_comlumnNames = colNames;
		_comlumnTypes = colTypes;
	}
	
	@Override
	public int getColumnCount() {
		return _comlumnNames.length;
	}
	
	@Override 
	public String getColumnName(int columnIndex) {
        return _comlumnNames[columnIndex];
    }
	@Override
	public Class<?> getColumnClass(int columnIndex) {
		return _comlumnTypes[columnIndex];
	}

	public String[] getColumnNames() {
		return _comlumnNames;
	}
		
	private static final long serialVersionUID = -7601074602017173418L;

	private final String[] _comlumnNames;  
	private final Class<?>[] _comlumnTypes;
	
}
